// @ts-ignore
/* eslint-disable */
import { ModelType } from 'umi';
import * as sysUserService from '@/services/sys/sysUserService';

const SysUser: ModelType = {
  namespace: 'sysUser',

  state: {
    name: '',
  },

  effects: {
    *updatePwd({ payload, callback }:any, { call }:any) {
      const response = yield call(sysUserService.updatePwd, payload);
      if (callback) {
        callback(response)
      }
    },
    *findPage({ payload, callback }:any, { call }:any) {
      const response = yield call(sysUserService.findPage, payload);
      if (callback) {
        callback(response)
      }
    },
    *addNewUser({ payload, callback }:any, { call }:any) {
      const response = yield call(sysUserService.addNewUser, payload);
      if (callback) {
        callback(response)
      }
    },
    *updateObject({ payload, callback }:any, { call }:any) {
      const response = yield call(sysUserService.updateObject, payload);
      if (callback) {
        callback(response)
      }
    },
    *fakeDelete({ payload, callback }:any, { call }:any) {
      const response = yield call(sysUserService.fakeDelete, payload);
      if (callback) {
        callback(response)
      }
    },
    *getLoginUserMenu({ payload, callback }:any, { call }:any) {
      const response = yield call(sysUserService.getLoginUserMenu, payload);
      if (callback) {
        callback(response)
      }
    },
    *updateStatus({ payload, callback }:any, { call }:any) {
      const response = yield call(sysUserService.updateStatus, payload);
      if (callback) {
        callback(response)
      }
    },
    *unlockUser({ payload, callback }:any, { call }:any) {
      const response = yield call(sysUserService.unlockUser, payload);
      if (callback) {
        callback(response)
      }
    },
  },
};

export default SysUser;
